package vm

import (
	"fuck/code"
	"fuck/object"
)

// Frame 调用帧，保存返回地址，当前函数的参数及其局部变量
type Frame struct {
	fn *object.CompiledFunction
	ip int
}

func NewFrame(fn *object.CompiledFunction) *Frame {
	return &Frame{fn: fn, ip: -1}
}

func (f *Frame) Instructions() code.Instructions {
	return f.fn.Instructions
}
